package com.sx.medicinecard.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sx.medicinecard.entity.SxOrderInfo;
import com.sx.medicinecard.entity.dto.SxOrderInfoDto;
import com.sx.medicinecard.entity.vo.SxOrderInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 订单表(SxOrderInfo)表数据库访问层
 *
 * @author makejava
 * @since 2024-03-30 15:21:27
 */
@Mapper
public interface SxOrderInfoMapper extends BaseMapper<SxOrderInfo> {

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<SxOrderInfo> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<SxOrderInfo> entities);


    IPage<SxOrderInfoVo> getOrderListByPage(@Param("page") IPage<SxOrderInfoVo> page, @Param("sxOrderInfoDto") SxOrderInfoDto sxOrderInfoDto);

    List<HashMap<String, Object>> selectOrderList(@Param("stringDate")String stringDate, @Param("channelCode") String channelCode);

    HashMap<String, Object> getChannelCodeByTradeNo(@Param("tradeNo") String tradeNo);

    List<HashMap<String, Object>> selectOrderListV2(@Param("stringDate") String stringDate,@Param("channelCode") String channelCode);
}

